<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>tableFrame_simple</title>
    <link rel="stylesheet" type="text/css" href="css/base_style.css" >
    <script>
        var infos;

        function updateTable(data,user,roadLine) {
            var tbody=document.getElementsByTagName("tbody")[0];
            infos = eval(data);

            tbody.innerHTML="";
            for (var item in infos) {
					if(infos[item].warnType=="无异常"){
					 tbody.innerHTML += "<tr class='"+(infos[item].warnType=="三"?(infos[item].statu==1?'row_yellow':'row_red'):(item%2==0?'row_odd':'row_even'))
                        +"' onclick='setBgColor(this)' >"
                        + "<td>" + (parseInt(item)+1) + "</td>"
                        + "<td>" + roadLine + "</td>"
                        + "<td>" + formatStr(infos[item].potTotal) + "</td>"
                        + "<td>" + formatStr(infos[item].potTotal) + "</td>"
                        + "<td>" + infos[item].checkDate + "</td>"
                        + "<td>" + user + "</td>"
                        + "<td>" + infos[item].warnType + "</td>"
                        + "<td>" + formatStr(infos[item].deal )+ "</td>"
                        + "<td>" + (infos[item].statu==0?'未上报':'已上报') + "</td>"
                      //  + "<td style='max-width: 200px;'>" + infos[item].photoNumber + "</td>"
                        + "</tr>";
					}else{
                tbody.innerHTML += "<tr class='"+(infos[item].warnType=="三"?(infos[item].statu==1?'row_yellow':'row_red'):(item%2==0?'row_odd':'row_even'))
                        +"' onclick='setBgColor(this)' >"
                        + "<td>" + (parseInt(item)+1) + "</td>"
                        + "<td>" + roadLine + "</td>"
                        + "<td>" + formatStr(infos[item].potTotal) + "</td>"
                        + "<td>" +"K"+formatStr(infos[item].endpotKm)+"+"+ formatStr(infos[item].endpotMeter) + "</td>"
                        + "<td>" + infos[item].checkDate + "</td>"
                        + "<td>" + user + "</td>"
                        + "<td>" + infos[item].warnType + "</td>"
                        + "<td>" + formatStr(infos[item].deal )+ "</td>"
                        + "<td>" + (infos[item].statu==0?'未上报':'已上报') + "</td>"
                      //  + "<td style='max-width: 200px;'>" + infos[item].photoNumber + "</td>"
                        + "</tr>";
                        }
            }
        }
        function formatStr(value){
            var pot="";
            if(typeof(value)!="undefined"){
                pot=value;
            }
            return pot;
        }

        function onDetailClick(item) {
            window.android.onShowPatrolDetail(item);
        }
        function setBgColor(ele)
        {
            for (var i = 0; i < ele.parentNode.rows.length; i++)
            {
                var trObj=ele.parentNode.rows[i];
                trObj.className = (infos[i].warnType=="三"?(infos[i].statu==1?'row_yellow':'row_red'):(i%2==0?'row_odd':'row_even'));
                if(ele==trObj){
                    window.android.onSelected(i);
                }
            }
            ele.className = 'row_selected';

        }
    </script>
</head>

<body>
<div>
    <table id="info_table" width="100%" cellpadding="0" cellspacing="0" border="1">
        <thead>
        <tr>
            <td>序号</td>
            <td>巡查路线</td>
            <td>出现问题开始桩号</td>
            <td>出现问题结束桩号</td>
            <td>巡道时间</td>
            <td>巡道人</td>
            <td>预判级别</td>
            <td>处置情况</td>
            <td>上报状态</td>
           <!-- <td>照片</td>-->
        </tr>
        </thead>
        <tbody>
        </tbody>
    </table>
</div>
</body>
</html>